#include <iostream>
#include <iomanip>
#include <string>

#pragma once  

class  __declspec(dllexport) ql  
{  
	public:  
		ql(void);  
		~ql(void);  

		std::string ql::SwigTest(std::string val);

		int ql::NextBizDate(int date, std::string period, std::string bizDayConv, bool endOfMonth, std::string holidays);
		int ql::NextBizDate(int date, std::string holidays);
		int ql::NextImmDate(int date);
		
		//boost::shared_ptr<QuantLib::YieldTermStructure> ql::GetYts(std::string marketName, std::string curveName);
		//boost::shared_ptr<QuantLib::PricingEngine> ql::GetEngine(std::string marketName, std::string engineName);
		//boost::shared_ptr<QuantLib::Bond> ql::GetBond(std::string marketName, std::string bondName);
		//boost::shared_ptr<QuantLib::Instrument> ql::GetTrade(std::string cacheName, std::string tradeId);

		std::string ql::MarketSet(std::string marketName, int todaysDate);
		std::string ql::MarketValueTrade(std::string market, std::string cacheName, std::string tradeId, std::string controlString);
		std::string ql::MarketValueTrades(std::string market, std::string cacheName, std::string controlString);
		
		std::string ql::DepoRate(std::string marketName, std::string instName, double rate, std::string tenor, int fixingDays, std::string dayCount, std::string bizConv,  std::string holidays);
		std::string ql::FraRate(std::string marketName, std::string instName, double rate, int start, int end, int fixingDays, std::string dayCount, std::string bizConv,  std::string holidays);
		std::string ql::FutRate(std::string marketName, std::string instName, double rate, int startDate, int futMonths,  std::string dayCount, std::string bizConv, std::string holidays);
		std::string ql::SwapRate(std::string marketName, std::string instName, double rate, std::string tenor, int fixingDays, int forwardStart, std::string floatLegIndex, std::string fixedLegFreq, std::string fixedLegDayCount, std::string fixedLegBizConv, std::string holidays);
		std::string ql::CdsSpread(std::string marketName, std::string instName, double spread, double recoveryRate, std::string tenor, int fixingDays, std::string dicountCurve, std::string freq, std::string dayCount, std::string bizConv, std::string holidays);
		
		std::string ql::Index(std::string marketName, std::string curveName, std::string indexName, std::string indexType, std::string tenor, std::string fixings);

		std::string ql::YieldCurve(std::string marketName, std::string curveName, std::string discountCurveName, int settlementDate, std::string rates, std::string dayCount, double tolerance, std::string holidays);
		std::string ql::FlatForwardCurve(std::string marketName, std::string curveName, std::string discountCurveName, int settlementDate, double rate, std::string dayCount);
		std::string ql::FlatForwardCurve(std::string marketName, std::string curveName, std::string discountCurveName, int settlementDate, double rate, std::string dayCount, std::string cpnFrq, std::string compounded);
		std::string ql::BondCurve(std::string marketName, std::string curveName, std::string discountCurveName, int settlementDate, std::string rates, std::string dayCount, double tolerance, std::string holidays);
		std::string ql::DefaultCurve(std::string marketName, std::string curveName, std::string discountCurveName, int settlementDate, std::string spreads, double recoveryRate, std::string dayCount, std::string holidays);
		std::string ql::VolSurf(std::string marketName, std::string curveName, std::string volSurfName, std::string vols, std::string index,  std::string model);
		std::string ql::ImpliedBlackVol(std::string marketName, std::string volSurfName, std::string modelName);

		std::string ql::VanillaSwap(std::string marketName, std::string cacheName, std::string id, std::string curveName, double nominal, int start, int maturity, double fixedRate, std::string payRec, std::string index, double spread, std::string  fixLegFrq, std::string fltLegFrq, std::string fixLegConv,  std::string fltLegConv, std::string fixLegDayCount, std::string fltLegDayCount, std::string holidays);
		std::string ql::BasisSwap(std::string marketName, std::string cacheName, std::string id, double nominal, int start, int maturity, std::string payRec, std::string curveName1, std::string index1, double spread1,  std::string fltLegFrq1, std::string fltLegConv1, std::string fltLegDayCount1,	std::string curveName2, std::string index2, double spread2,  std::string fltLegFrq2, std::string fltLegConv2, std::string fltLegDayCount2, std::string holidays);
		std::string ql::FloatingLeg(std::string marketName, std::string cacheName, std::string id, double nominal, int start, int maturity, std::string payRec, std::string curveName, std::string index, double spread,  std::string fltLegFrq, std::string fltLegConv, std::string fltLegDayCount, std::string holidays);
		std::string ql::FixedLeg(std::string marketName, std::string cacheName, std::string id, std::string curveName, double nominal, int start, int maturity, double fixedRate, std::string payRec, std::string index, std::string  fixLegFrq, std::string fixLegConv,  std::string fixLegDayCount, std::string holidays);
		std::string ql::ForwardRateAgreement(std::string marketName, std::string cacheName, std::string id, std::string curveName, double nominal, int start, int maturity, double fixedRate, std::string payRec, std::string index);
		
		std::string ql::Swaption(std::string marketName, std::string cacheName, std::string id, std::string curveName, std::string volSurfName, double nominal, int start, int maturity, double strike, std::string payRec, std::string index, double spread, std::string  fixLegFrq, std::string fltLegFrq, std::string fixLegConv,  std::string fltLegConv, std::string fixLegDayCount, std::string fltLegDayCount, std::string holidays);
		std::string ql::BermudanSwaption(std::string marketName, std::string cacheName, std::string id, std::string curveName, std::string volSurfName, double nominal, int start, int maturity, double strike, std::string payRec, std::string index, double spread, std::string  fixLegFrq, std::string fltLegFrq, std::string fixLegConv,  std::string fltLegConv, std::string fixLegDayCount, std::string fltLegDayCount, std::string holidays);
		
		std::string ql::CreditDefaultSwap(std::string marketName, std::string cacheName, std::string id, std::string curveName, double quotedSpread, std::string ProtSellBuy, double nominal, int start, int maturity, std::string premFreq, std::string premConv, std::string payConv, std::string dayCount, std::string holidays);
		
		std::string ql::FixedRateBondBuild(std::string marketName, std::string bondName, double coupon, double mktPrice, std::string couponFrq, double redemption, int settlementDays, int effectiveDate, int terminationDate, std::string dayCount, std::string payConv, std::string termConv, std::string bondConv, std::string holidays);
		std::string ql::FixedRateBond(std::string marketName, std::string cacheName, std::string id, std::string bondName, std::string curveName, double nominal,  int settlementDate, double cleanTradePrice);
		std::string ql::FloatingRateBondBuild(std::string marketName, std::string bondName, double spread, std::string curveName, std::string index, std::string couponFrq, double redemption, int settlementDays, int effectiveDate, int terminationDate, std::string dayCount, std::string payConv, std::string termConv, std::string bondConv, std::string holidays);
		std::string ql::FloatingRateBond(std::string marketName, std::string cacheName, std::string id, std::string bondName, std::string curveName, double nominal,  int settlementDate, double cleanTradePrice);
		std::string ql::ZeroCouponBondBuild(std::string marketName, std::string bondName, double redemption, int settlementDays, int effectiveDate, int terminationDate, std::string bondConv, std::string holidays);
		std::string ql::ZeroCouponBond(std::string marketName, std::string cacheName, std::string id, std::string bondName, std::string curveName, double nominal,  int settlementDate, double cleanTradePrice);
		std::string ql::FixedRateBondForward(std::string marketName, std::string fwdbondName,  std::string bondName, std::string repoCurveName, std::string bondCurveName, double price, int settlementDate, int deliveryDate, int settlementDays, std::string repoConv, std::string bondConv, std::string holidays);

		std::string ql::Repo(std::string marketName, std::string cacheName, std::string id, std::string bondName, std::string repoCurveName, std::string bondCurveName, double strike, double nominal, int settlementDate, int deliveryDate,  int settlementDays, std::string repoConv, std::string bondConv, std::string holidays);
};

